package com.ycg.vue.config;

import com.ycg.vue.component.Interceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Description
 * @Author jink
 * @Date 2024/1/9
 */
@Configuration
public class webConfig implements WebMvcConfigurer {
    //拦截器对象
    @Autowired
    private Interceptor interceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //注册自定义拦截器对象
        registry.addInterceptor(interceptor)
                .addPathPatterns("/**")
                .excludePathPatterns("/login")
                .excludePathPatterns("/doc.html/**")
                .excludePathPatterns("/swagger-resources/**", "/webjars/**", "/v2/**","/register","/system/sendMail/**");
    }
}
